﻿<div class="container-fluid">
<?php
	session_start();

	extract($_POST);
	extract($_GET);
	unset($_POST,$_GET);
	if (isset($logout) && $logout == 1)
	{
		unset($_SESSION['user']);
		$_SESSION=array();
		unset($_SESSION);
		setcookie(session_name(),"",time()-1);
		echo "<script>alert('注销登录成功!!!');window.location='../index.php';</script>";
	}		
?>
	<nav class="navbar navbar-default" role="navigation">
		<div class="container-fluid">
		<div class="navbar-header">
			<button type="button" class="navbar-toggle" data-toggle="collapse"
				data-target="#example-navbar-collapse">
				<span class="sr-only">切换导航</span>
				<span class="icon-bar"></span>
				<span class="icon-bar"></span>
				<span class="icon-bar"></span>
			</button>
			<a class="navbar-brand" href="/index.php"><font color='red'><span class="glyphicon glyphicon-cog"></span> 管理面板</font></a>
		</div>
		<div  class="collapse navbar-collapse" id="example-navbar-collapse">
			<ul class="nav navbar-nav">
				<li><a href="admin_index.php?name=issue"><span class="glyphicon glyphicon-question-sign"></span> 问题追踪</a></li>
				<li><a href="admin_index.php?name=version"><span class="glyphicon glyphicon-list-alt"></span> 版本管控</a></li>
				<li><a href="admin_index.php?name=wiki"><span class="glyphicon glyphicon-globe"></span> 工程维基</a></li>
				<li><a href="admin_index.php?name=project"><span class="glyphicon glyphicon-exclamation-sign"></span> 专案漏失</a></li>
				<li><a href="admin_index.php?name=gmmaker"><span class="glyphicon glyphicon-hdd"></span> 母盘清单</a></li>
				<li class="dropdown">
					<a href="#" class="dropdown-toggle" data-toggle="dropdown">
						<span class="glyphicon glyphicon-compressed"></span> 资料管理
						<b class="caret"></b>
					</a>
					<ul class="dropdown-menu">
						<? 	if ($_SESSION['user']==1) {
								echo "<li><a href='admin_index.php?name=file'><span class=\"glyphicon glyphicon-paperclip\"></span> 文档查询</a></li>";
								echo "<li><a href='admin_index.php?name=mail'><span class=\"glyphicon glyphicon-envelope\"></span> 邮件追踪</a></li>";
								if ($_SESSION['useradmin']==0){
									echo "<li class='divider'></li>";
									echo "<li><a href='admin_index.php?name=repo'><span class=\"glyphicon glyphicon-shopping-cart\"></span> 库存管理</a></li>	";	
									echo "<li><a href='admin_index.php?name=users'><span class=\"glyphicon glyphicon-user\"></span> 用户管理</a></li>";
									echo "<li><a href='admin_index.php?name=ad'><span class=\"glyphicon glyphicon-bullhorn\"></span> 公告管理</a></li>";
									echo "<li><a href='admin_index.php?name=kpi'><span class=\"glyphicon glyphicon-tree-conifer\"></span> 绩效管理</a></li>";
								}else{
									echo "<li><a href='../repo_list.php'><span class=\"glyphicon glyphicon-shopping-cart\"></span> 库存查询</a></li>";
								}
								echo "<li class='divider'></li>";
								echo "\n\t\t\t\t\t\t<li><a href=\"#\" onclick=\"javascript:window.open('ssidList.php','SSID管理', 'height=800, width=750, toolbar=no, menubar=no, scrollbars=yes, resizable=yes,location=no, status=no');\"><span class=\"glyphicon glyphicon-tag\"></span> SSID管理</a></li>";
								echo "\n\t\t\t\t\t\t<li><a href=\"#\" onclick=\"javascript:window.open('dutyList.php','值班管理', 'height=800, width=750, toolbar=no, menubar=no, scrollbars=yes, resizable=yes,location=no, status=no');\"><span class=\"glyphicon glyphicon-tasks\"></span> 值班管理</a></li>";
								echo "\n\t\t\t\t\t\t<li><a href=\"#\" onclick=\"javascript:window.open('gmList.php?pagename=moditem','母盘项目', 'height=800, width=750, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no');\"><span class=\"glyphicon glyphicon-hdd\"></span> 母盘项目</a></li>";
								echo "\n\t\t\t\t\t\t<li><a href=\"#\" onclick=\"javascript:window.open('oakeyList.php','DPK管理', 'height=600, width=1200, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no');\"><span class=\"glyphicon glyphicon-star\"></span> DPK处理</a></li>\n";
								echo "\n\t\t\t\t\t\t<li><a href=\"#\" onclick=\"javascript:window.open('biosmon.php','BIOS监视', 'height=600, width=1200, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no');\"><span class=\"glyphicon glyphicon-film\"></span> BIOS监视</a></li>\n";
								echo "\n\t\t\t\t\t\t<li><a href=\"#\" onclick=\"javascript:window.open('admin_testCode.php','测试料号描述', 'height=600, width=1200, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no');\"><span class=\"glyphicon glyphicon-credit-card\"></span> 测试料号</a></li>\n";

							}
						?>
					</ul>
				</li>
			</ul>
			<? 	if ($_SESSION['user']==1) { ?>
	<ul class="nav navbar-nav navbar-right"> 
				<li class="dropdown">
						<a href="#" class="dropdown-toggle" data-toggle="dropdown">
							<span class="glyphicon glyphicon-pencil"></span> 添加资料
							<b class="caret"></b>
						</a>
						<ul class="dropdown-menu">
							<li><a href="#" onclick="javascript:window.open('add_issue.php','添加问题', 'height=800, width=600, toolbar=no, menubar=no, scrollbars=yes, resizable=yes,location=no, status=no');"><span class="glyphicon glyphicon-question-sign"></span> 添加问题</a></li>
							<li><a href="#" onclick="javascript:window.open('add_verlist.php','添加版本', 'height=800, width=600, toolbar=no, menubar=no, scrollbars=yes, resizable=yes,location=no, status=no');"><span class="glyphicon glyphicon-list-alt"></span> 添加版本</a></li>
							<li><a href="#" onclick="javascript:window.open('add_wiki.php','添加维基', 'height=800, width=600, toolbar=no, menubar=no, scrollbars=yes, resizable=yes,location=no, status=no');"><span class="glyphicon glyphicon-folder-close"></span> 添加维基</a></li>
							<li><a href="#" onclick="javascript:window.open('add_project.php','专案漏失', 'height=800, width=600, toolbar=no, menubar=no, scrollbars=yes, resizable=yes,location=no, status=no');"><span class="glyphicon glyphicon-exclamation-sign"></span> 专案漏失</a></li>
							<li><a href="#" onclick="javascript:window.open('add_repo.php','添加库存', 'height=800, width=600, toolbar=no, menubar=no, scrollbars=yes, resizable=yes,location=no, status=no');"><span class="glyphicon glyphicon-shopping-cart"></span> 添加库存</a></li>
							<li><a href="#" onclick="javascript:window.open('add_gmMaker.php','母盘制作', 'height=800, width=1000, toolbar=no, menubar=no, scrollbars=yes, resizable=yes,location=no, status=no');"><span class="glyphicon glyphicon-hdd"></span> 添加母盘</a></li>							
							<li><a href="#" onclick="javascript:window.open('add_mail.php','邮件追踪', 'height=500, width=800, toolbar=no, menubar=no, scrollbars=yes, resizable=yes,location=no, status=no');"><span class="glyphicon glyphicon-envelope"></span> 邮件追踪</a></li>
<? 
						if ($_SESSION['useradmin']==0) { 
?>
							<li class="divider"></li>
							<li><a href="#" onclick="javascript:window.open('add_ad.php','编写公告', 'height=450, width=748, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');"><span class="glyphicon glyphicon-bullhorn"></span> 添加公告</a></li>
							<li><a href="#" onclick="javascript:window.open('add_file.php','上传文件', 'height=450, width=748, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');"><span class="glyphicon glyphicon-paperclip"></span> 添加文档</a></li>
<? 
						}
		echo "		</ul>";
		echo "	</li>";

					if($_SESSION['user']==1){
						echo '<li><a href="admin_index.php?name=daily"><span class="glyphicon glyphicon-folder-open"></span> 日报库</a></li>';
						if($_SESSION['logname'] == "Admin"){
							if ($_SESSION['useradmin']==0)  echo '<li><a href="admin_index.php?name=kpi">KPI</a></li>';
							echo '<li><a href="admin_index.php?name=users"> '.$_SESSION['logname'].'</a></li>.|.<a href="admin/admin_top.php?logout=1"> 注销</a>';
						}else{
							echo "<li><a href='admin_index.php?name=weekly'><span class='glyphicon glyphicon-book'></span> 周报库</a></li>";
							echo '<li><a href="userinfo.php?id='.$_SESSION['ID'].'"><span class="glyphicon glyphicon-user"></span> '.$_SESSION['logchnname'].'</a></li><li><a href="admin_top.php?logout=1"><span class="glyphicon glyphicon-log-out"></span> 注销</a></li>';
						}
					}else
						echo '<li><a href="userinfo.php"><span class="glyphicon glyphicon-log-in"></span> 登录</a></li>';

				echo "</ul> ";
			 }
	echo "		</div>	";
	echo "		</div>	";
	echo "	</nav>";
	echo "</div>";
?>